﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Freedom.Models.ViewModels.PortfolioViewModel>" %>
<%@ Import Namespace="MvcPaging" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	成功案例
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <!-- PAGE TITLE -->
	<div class="container m-bot-35 clearfix">
		<div class="sixteen columns">
			<div class="page-title-container clearfix">
				<h1 class="page-title">成功案例</h1>
				<%--<ul id="filter"> 
					<li class="current all" title="All"><a href="#">All</a></li> 
                <%
                    int i = 0;
                    foreach (var item in Model.portfolioClassList)
                    {
                        i++;
                %>
					<li class="category<%= item.ID %>" title="<%= item.Class%>"><a href="#"><%= item.Class%></a></li>
                <%
                    }
                %>
				</ul>--%>
			</div>	
		</div>
	</div>	
	
<!-- CONTENT -->
	<div class="container filter-portfolio clearfix">
		<ul id="portfolio" class="clearfix">
        <%
            foreach (var item in Model.portfolioInfoPagedList)
            {
        %>
		 <!-- PORTFOLIO ITEM -->
			<li data-id="id-<%= item.ClassID %>" data-type="category<%= item.ClassID %>" class="eight columns m-bot-35">
				<div class="content-container-white hover-item">
					<div class="view view-first">
						<img src="../../Content/images/content/<%= item.SmallImage %>" alt="Ipsum" >
						<div class="abs">
                            <%--<a href="../../Content/images/content/<%= item.BigImage %>" class="lightbox zoom info"></a><a href="/Portfolio/Single" class="link info"></a>--%>
							<a href="../../Content/images/content/<%= item.BigImage %>" class="lightbox zoom info"></a><a href="<%= item.Link %>" class="link info"></a>
						</div>	
					</div>
					<div class="lw-item-caption-container">
                        <%--<a class="a-invert" href="/Portfolio/Single" ><span class="bold"><%= item.Title %></span></a>--%>
						<a class="a-invert" href="<%= item.Link %>" ><span class="bold"><%= item.Title %></span></a>
						<div class="item-caption"><%= item.Intro %></div>
					</div>
				</div>
			</li>
        <%
            }
        %>
		<!-- PORTFOLIO ITEM -->
			<!-- deleted -->
		<!-- PORTFOLIO ITEM -->
			<!-- deleted -->	

		</ul>
	</div>	
<!-- PAGINATION -->
    <div class="container m-bot-35 clearfix">
		<div class="pagination-1-container sixteen columns">
            <%--<%= Html.Pager(Model.portfolioInfoPagedList.PageSize, Model.portfolioInfoPagedList.PageNumber, Model.portfolioInfoPagedList.TotalItemCount) %>--%>
            <%
                int[] count = new int[Model.portfolioClassList.Count];
                var pagedList = Model.portfolioInfoPagedList;
                foreach (var item in Model.portfolioInfoList)
                {
                    count[(int)item.ClassID - 1]++;
                }
            %>
            <%--<%= count.Length + " | " + count[0] + " | " + count[1] + " | " + count[2] + " | " + nClassID %>--%>
            <%--<input id="portfolioClass" value="All" type="hidden" />--%>
            <%--<form  runat="server">
            <asp:HiddenField ID="portfolioClass" Value="All" runat="server" />
            </form>--%>
			<ul class="pagination-1">
				<li>
					<a class="pag-prev" href="/Portfolio?page=<%= pagedList.PageNumber > 1 ? pagedList.PageNumber - 1 : 1 %>"></a>
				</li>
            <%
                int currentCount = 0;
                
                // 分类型
                // currentCount = count[0];// 判断类型
                
                // 不分类型
                int m = pagedList.TotalItemCount / pagedList.PageSize;
                int n = pagedList.TotalItemCount % pagedList.PageSize;
                int c = m + (n > 0 ? 1 : 0);
                currentCount = c;// 判断类型
                
                for (int page = 1; page <= currentCount; page++)
                {
            %>
                <li>
					<a class="<%= pagedList.PageNumber == page ? "pag-current" : "" %>" href="/Portfolio?page=<%= page %>"><%= page %></a>
				</li>
            <% 
                }
            %>
				<li>
					<a class="pag-next" href="/Portfolio?page=<%= pagedList.PageNumber < currentCount ? pagedList.PageNumber + 1 : currentCount %>"></a>
				</li>
			</ul>
		</div>
	</div>

	
	
	

<!-- NEWS LETTER -->
	<!-- deleted -->
	
<!-- OUR CLIENTS -->	
	<!-- deleted -->

</asp:Content>
